//! @Author: DengLibin
//! @Date: Create in 2023-11-02 14:25:29
//! @Description: 日志



use log::{debug, error, info, trace, warn};

pub struct LogError {
    pub msg: String,
}

/// @Author: DengLibin
/// @Date: Create in 2023-11-02 14:36:28
/// @Description: 初始化日志系统
pub fn init_log(log4rspath: &str) -> Result<(), Box<dyn std::error::Error>> {
    let r = log4rs::init_file(log4rspath, Default::default())?;
    Ok(r)
}

/// @Author: DengLibin
/// @Date: Create in 2023-11-02 14:37:15
/// @Description: 示例
pub fn demo() {
    trace!("this is trace:{}", 1);
    debug!("this is debug:{}", 1);
    info!("this is info:{}", 1);
    warn!("this is warn:{}", 2);
    error!("this is error:{}", 3);
}
